package com.vrv.netmgr.assets.detail;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;

import com.vrv.common.GlobalConstants;
import com.vrv.netmgr.R;
import com.vrv.netmgr.vo.HardwareChange;
import com.vrv.netmgr.vo.SoftwareChange;

/**
 * @Description 注册资产查询策略详细信息
 * @author yangzijian
 * @date
 * 
 */
public class DetailSoftwareChangedActivity extends Activity {
    private static final String TAG = DetailSoftwareChangedActivity.class.getSimpleName();
    private static final boolean DEBUG = true && GlobalConstants.DEBUG;
	//
	private SoftwareChange info;
	public void onCreate(Bundle savedInstanceState){
		if(DEBUG) Log.v(TAG, "onCreate()");
		
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.detail_softwarechange);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
		getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
		//
		initViews();
		setTitle();
	}
	//
	public void initViews(){
		if(DEBUG) Log.v(TAG, "initViews()");
		
		//
		TextView sftc_className = (TextView) findViewById(R.id.sftc_className);
		TextView sftc_deptName = (TextView) findViewById(R.id.sftc_deptName);
		TextView sftc_officeName = (TextView) findViewById(R.id.sftc_officeName);
		TextView sftc_userName = (TextView) findViewById(R.id.sftc_userName);
		TextView sftc_tel = (TextView) findViewById(R.id.sftc_tel);
		TextView sftc_ipaddres = (TextView) findViewById(R.id.sftc_ipaddres);
		TextView sftc_softwareName = (TextView) findViewById(R.id.sftc_softwareName);
		TextView sftc_setupTime = (TextView) findViewById(R.id.sftc_setupTime);
		TextView sftc_unInstallTime = (TextView) findViewById(R.id.sftc_unInstallTime);
		TextView sftc_findTime = (TextView) findViewById(R.id.sftc_findTime);
		//
		info = (SoftwareChange) getIntent().getSerializableExtra("info");
		//
		sftc_className.setText(info.getSftc_className());
		sftc_deptName.setText(info.getSftc_deptName());
		sftc_officeName.setText(info.getSftc_officeName());
		sftc_userName.setText(info.getSftc_userName());
		sftc_tel.setText(info.getSftc_tel());
		sftc_ipaddres.setText(info.getSftc_ipaddres());
		sftc_softwareName.setText(info.getSftc_softwareName());
		sftc_setupTime.setText(info.getSftc_setupTime());
		sftc_unInstallTime.setText(info.getSftc_unInstallTime());
		sftc_findTime.setText(info.getSftc_findTime());
	}
	public void setTitle() {
		if(DEBUG) Log.v(TAG, "setTitle()");
		
		TextView title = (TextView) findViewById(R.id.title_text);
		title.setText("软件变化查询"+"["+info.getSftc_ipaddres()+"]");

		/**
		 * 返回按钮
		 */
		ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
		backBtn.setVisibility(View.VISIBLE);
		backBtn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
	}
	@Override
	public void onBackPressed() {
		if(DEBUG) Log.v(TAG, "onBackPressed()");
		
		finish();
		overridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);
		super.onBackPressed();
	}
}
